package main

import "fmt"

type symbolTable struct {
	data []string
}

func NewSymbolTable() *symbolTable {
	return &symbolTable{
		data: make([]string, 0),
	}
}

func (s *symbolTable) print() {
	for _, e := range s.data {
		fmt.Println(e)
	}
}

func (s *symbolTable) contains(str string) bool {
	for _, e := range s.data {
		if e == str {
			return true
		}
	}
	return false
}

func (s *symbolTable) addItem(str string) {
	if !s.contains(str) {
		s.data = append(s.data, str)
	}
}
